const path = require('path');
module.exports = {
    entry: './src/index.js',
    output: {
        path: __dirname + '/dist',
        filename: 'bundle.js'
    },
    devServer: {
        historyApiFallback: true,
        proxy: {
            "/api": {
                target: 'http://localhost/',
                pathRewrite: {"^/api" : ""}
            }
        }
    },
    module: {
        rules: [
            {
                test: /\.js$/,
                exclude: /node_modules/,
                use: {
                    loader: 'babel-loader',
                    options: {
                        presets: ['es2015', 'react']
                    }
                }
            }, {
                test: /\.css$/,
                use: [ 'style-loader', 'css-loader' ]
            }, {
                test: /\.eot$/,
                use: {
                    loader: 'file-loader'
                }
            }, {
                test: /\.ttf$/,
                use: {
                    loader: 'url-loader',
                    options: {
                        limit: 10000,
                        mimetype: 'application/octet-stream'
                    }
                }
            }, {
                test: /\.svg$/,
                use: {
                    loader: 'url-loader',
                    options:{
                        limit: 10000,
                        mimetype: 'image/svg+xml'
                    }
                }
            }, {
                test: /\.woff$/,
                use: {
                    loader: 'url-loader',
                    options:{
                        limit: 10000,
                        mimetype: 'application/font-woff'
                    }
                }
            }
        ]
    }
};